<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSGO完美时刻 - {{ player_name }}</title>
    <!-- 引入自定义字体，请确保 .ttf 文件路径正确 -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap">
    <style>
        /* 声明自定义字体，请确保路径正确 */
        @font-face {
            font-family: AlibabaHealthFont2;
            src: url("{{ asset('fonts/AlibabaHealthFont2.0CN-85B.ttf') }}");
        }

        @font-face {
            font-family: fzrzFont;
            src: url("{{ asset('fonts/fzrzExtraBold.ttf') }}");
        }

        :root {
            --primary-bg: #fff5f7;
            --card-bg: white;
            --border-color-light: #f3868c;
            --shadow-color-light: rgba(247, 123, 142, 0.15);
            --gradient-start: #f67186;
            --gradient-end: #f7889c;
            --text-dark: #333333;
            --text-highlight: #f67186;
            --section-title-bar: #f67186;
            --section-title-bar-end: #f7889c;
            --csgo-t-side-color: #ffc107;
            --csgo-ct-side-color: #2196f3;
            --csgo-win-color: #4CAF50;
            --csgo-lose-color: #F44336;
        }

        body {
            margin: 0;
            padding: 0;
            background-color: var(--primary-bg);
            background-image: linear-gradient(45deg, rgba(247, 123, 142, 0.05) 25%, transparent 25%, transparent 75%, rgba(247, 123, 142, 0.05) 75%, rgba(247, 123, 142, 0.05)),
                linear-gradient(45deg, rgba(247, 123, 142, 0.05) 25%, transparent 25%, transparent 75%, rgba(247, 123, 142, 0.05) 75%, rgba(247, 123, 142, 0.05));
            background-size: 60px 60px;
            background-position: 0 0, 30px 30px;
            display: flex;
            justify-content: center;
            align-items: flex-start;
            min-height: 100vh;
            font-family: "AlibabaHealthFont2", "Inter", sans-serif;
        }

        .wrapper {
            width: 900px;
            background: var(--card-bg);
            border-radius: 20px;
            padding: 35px 30px;
            box-sizing: border-box;
            box-shadow: 0 15px 40px var(--shadow-color-light);
            margin: 40px 0;
            display: flex;
            flex-direction: column;
            gap: 30px;
            position: relative;
            overflow: hidden;
        }

        .wrapper::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 6px;
            background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
        }

        .app-header {
            text-align: center;
            position: relative;
            padding-bottom: 25px;
        }

        .app-title {
            font-size: 38px;
            background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            margin: 10px 0;
            font-weight: 800;
            letter-spacing: -0.5px;
            text-shadow: 0 2px 10px rgba(247, 123, 142, 0.2);
        }

        .app-subtitle {
            font-size: 16px;
            color: var(--gradient-end);
            margin: 0;
            font-weight: 500;
            letter-spacing: 1px;
        }

        .info-box {
            position: relative;
            background: var(--card-bg);
            border: 2px solid var(--border-color-light);
            border-radius: 16px;
            padding: 25px;
            box-shadow: 0 8px 16px var(--shadow-color-light);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .section-title {
            font-family: "fzrzFont", "Inter", sans-serif;
            font-size: 24px;
            color: var(--text-highlight);
            margin: 0 0 20px 0;
            display: flex;
            align-items: center;
            font-weight: bold;
        }

        .section-title:before {
            content: "";
            display: inline-block;
            width: 8px;
            height: 24px;
            background: linear-gradient(to bottom, var(--section-title-bar), var(--section-title-bar-end));
            margin-right: 12px;
            border-radius: 4px;
        }

        .player-info-panel {
            display: flex;
            align-items: center;
            padding-bottom: 25px;
            border-bottom: 1px dashed rgba(247, 123, 142, 0.3);
            margin-bottom: 25px;
        }

        .player-avatar {
            width: 110px;
            height: 110px;
            border-radius: 50%;
            object-fit: cover;
            border: 4px solid var(--gradient-start);
            margin-right: 25px;
            box-shadow: 0 5px 15px rgba(247, 123, 142, 0.3);
        }

        .player-details {
            flex-grow: 1;
        }

        .player-name {
            font-size: 28px;
            font-weight: 800;
            margin: 0 0 8px 0;
            background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            letter-spacing: -0.5px;
        }

        .steam-id {
            font-size: 15px;
            color: #888;
            margin: 0;
            display: flex;
            align-items: center;
        }

        .steam-id::before {
            content: "";
            display: inline-block;
            width: 16px;
            height: 16px;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="%23888" d="M496 256c0 137-111.2 248-248.4 248-113.8 0-209.6-76.3-239-180.4l95.2 39.3c6.4 32.1 34.9 56.4 68.9 56.4 39.2 0 71.9-32.4 70.2-73.5l84.5-60.2c52.1 1.3 95.8-40.9 95.8-93.5 0-51.6-42-93.5-93.7-93.5s-93.7 42-93.7 93.5v1.2L176.6 279c-15.5-.9-30.7 3.4-43.5 12.1L0 236.1C10.2 108.4 117.1 8 247.6 8 384.8 8 496 119 496 256zM155.7 384.3l-30.5-12.6a52.79 52.79 0 0 0 27.2 25.8c26.9 11.2 57.8-1.6 69-28.4 5.4-13 5.5-27.3.1-40.3-5.4-13-15.5-23.2-28.5-28.6-12.9-5.4-26.7-5.2-38.9-.6l31.5 13c19.8 8.2 29.2 30.9 20.9 50.7-8.3 19.9-31 29.2-50.8 21zm173.8-129.9c-34.4 0-62.4-28-62.4-62.3s28-62.3 62.4-62.3 62.4 28 62.4 62.3-27.9 62.3-62.4 62.3zm.1-15.6c25.9 0 46.9-21 46.9-46.8 0-25.9-21-46.8-46.9-46.8s-46.9 21-46.9 46.8c.1 25.8 21.1 46.8 46.9 46.8z"/></svg>');
            background-repeat: no-repeat;
            background-position: center;
            margin-right: 6px;
        }

        .meta-container {
            position: relative;
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 30px;
            background: var(--card-bg);
            /* 使用 CSS 变量 */
            border: 2px solid var(--border-color-light);
            /* 使用 CSS 变量 */
            border-radius: 12px;
            padding: 15px;
            box-shadow: 0 4px 8px var(--shadow-color-light);
            /* 使用 CSS 变量 */
            margin-bottom: 25px;
        }

        .meta-item {
            text-align: center;
            flex-basis: auto;
            min-width: 120px;
        }

        .meta-label {
            font-size: 14px;
            color: var(--text-highlight);
            /* 使用 CSS 变量 */
            margin-bottom: 5px;
        }

        .meta-value {
            font-size: 16px;
            color: var(--text-dark);
            /* 使用 CSS 变量 */
            font-weight: bold;
        }

        .divider {
            height: 1px;
            background: linear-gradient(to right, transparent, var(--gradient-end), transparent);
            margin: 0;
        }

        /* 视频列表样式 - 卡片网格 */
        .videos-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
            gap: 25px;
            margin-top: 25px;
        }

        @media (max-width: 768px) {
            .videos-grid {
                grid-template-columns: 1fr;
            }
        }

        .video-card {
            background: rgba(255, 250, 250, 0.9);
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 5px 15px rgba(247, 123, 142, 0.12);
            display: flex;
            flex-direction: column;
            transition: all 0.3s ease;
            position: relative;
            height: 100%;
        }

        .video-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(247, 123, 142, 0.25);
        }

        .video-thumbnail {
            width: 100%;
            height: 180px;
            position: relative;
            overflow: hidden;
            background-color: rgba(247, 123, 142, 0.05);
        }

        .video-cover {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
            display: block;
        }

        .video-card:hover .video-cover {
            transform: scale(1.05);
        }

        .video-cover-placeholder {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, rgba(247, 123, 142, 0.1), rgba(247, 123, 142, 0.05));
            color: #999;
            font-size: 14px;
        }

        .video-header {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            padding: 12px;
            display: flex;
            justify-content: space-between;
            z-index: 2;
            box-sizing: border-box;
        }

        .video-id {
            font-size: 13px;
            color: #fff;
            background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
            padding: 4px 12px;
            border-radius: 20px;
            font-weight: bold;
            box-shadow: 0 2px 8px rgba(247, 123, 142, 0.3);
            max-width: 45%;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .video-time {
            color: #fff;
            background: rgba(0, 0, 0, 0.6);
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
            max-width: 45%;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            display: flex;
            align-items: center;
        }

        .video-time::before {
            content: "";
            display: inline-block;
            width: 12px;
            height: 12px;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="%23fff" d="M256 0a256 256 0 1 1 0 512A256 256 0 1 1 256 0zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"/></svg>');
            background-repeat: no-repeat;
            background-position: center;
            margin-right: 5px;
        }

        .video-content {
            padding: 18px;
        }

        .video-title {
            font-size: 17px;
            font-weight: bold;
            color: var(--text-dark);
            margin-bottom: 12px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 1.4;
        }

        .video-details {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 12px;
        }

        .video-detail-item {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .detail-label {
            font-size: 12px;
            color: #888;
        }

        .detail-value {
            font-size: 13px;
            font-weight: bold;
            color: var(--text-dark);
        }

        .video-map {
            background-color: rgba(33, 150, 243, 0.1);
            color: #2196f3;
            padding: 5px 10px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 12px;
            display: flex;
            align-items: center;
        }

        .video-map::before {
            content: "";
            display: inline-block;
            width: 12px;
            height: 12px;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path fill="%232196f3" d="M288 0c-69.59 0-126 56.41-126 126 0 56.26 82.35 158.8 113.9 196.02 6.39 7.54 17.82 7.54 24.2 0C331.65 284.8 414 182.26 414 126 414 56.41 357.59 0 288 0zm0 168c-23.2 0-42-18.8-42-42s18.8-42 42-42 42 18.8 42 42-18.8 42-42 42zM20.12 215.95A32.006 32.006 0 0 0 0 245.66v250.32c0 11.32 11.43 19.06 21.94 14.86L160 448V214.92c-8.84-15.98-16.07-31.54-21.25-46.42L20.12 215.95zM288 359.67c-14.07 0-27.38-6.18-36.51-16.96-19.66-23.2-40.57-49.62-59.49-76.72v182l192 64V266c-18.92 27.09-39.82 53.52-59.49 76.72-9.13 10.77-22.44 16.95-36.51 16.95zm266.06-198.51L416 224v288l139.88-55.95A31.996 31.996 0 0 0 576 426.34V176.02c0-11.32-11.43-19.06-21.94-14.86z"/></svg>');
            background-repeat: no-repeat;
            background-position: center;
            margin-right: 5px;
        }

        .video-kill-count {
            background-color: rgba(244, 67, 54, 0.1);
            color: #F44336;
            padding: 5px 10px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 12px;
            display: flex;
            align-items: center;
        }

        .video-kill-count::before {
            content: "";
            display: inline-block;
            width: 12px;
            height: 12px;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="%23F44336" d="M505 41c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L396.5 81.5C358.1 50.6 309.2 32 256 32C132.3 32 32 132.3 32 256c0 53.2 18.6 102.1 49.5 140.5L7 471c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l74.5-74.5c38.4 31 87.3 49.5 140.5 49.5c123.7 0 224-100.3 224-224c0-53.2-18.6-102.1-49.5-140.5L505 41zM362.3 149.7c6.2 6.2 6.2 16.4 0 22.6l-48 48c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l48-48c6.2-6.2 16.4-6.2 22.6 0zm-192 192c6.2 6.2 6.2 16.4 0 22.6l-48 48c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l48-48c6.2-6.2 16.4-6.2 22.6 0zm96 0c6.2 6.2 6.2 16.4 0 22.6l-48 48c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l48-48c6.2-6.2 16.4-6.2 22.6 0zm-96-192c6.2 6.2 6.2 16.4 0 22.6l-48 48c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l48-48c6.2-6.2 16.4-6.2 22.6 0z"/></svg>');
            background-repeat: no-repeat;
            background-position: center;
            margin-right: 5px;
        }

        .detail-badge {
            display: inline-flex;
            align-items: center;
            background: rgba(247, 123, 142, 0.08);
            color: var(--text-highlight);
            padding: 5px 10px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
        }

        .detail-badge::before {
            content: "";
            display: inline-block;
            width: 12px;
            height: 12px;
            margin-right: 5px;
        }

        .detail-badge.versus::before {
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path fill="%23f67186" d="M384 32H512c17.7 0 32 14.3 32 32s-14.3 32-32 32H398.4c-5.2 25.8-22.9 47.1-46.4 57.3V448H512c17.7 0 32 14.3 32 32s-14.3 32-32 32H320 128c-17.7 0-32-14.3-32-32s14.3-32 32-32H288V153.3c-23.5-10.3-41.2-31.6-46.4-57.3H128c-17.7 0-32-14.3-32-32s14.3-32 32-32H256c14.6-19.4 37.8-32 64-32s49.4 12.6 64 32zm55.6 288H584.4L512 195.8 439.6 320zM512 96c-26.5 0-48 21.5-48 48c0 5.4 .9 10.7 2.6 15.6L556.2 368H467.6c-12.2 14.3-30.3 24-50.6 24h-32c-35.3 0-64-28.7-64-64V261.3c-19.1 16.8-44.3 27.7-72 29.5V448c0 35.3 28.7 64 64 64H544c35.3 0 64-28.7 64-64V368c0-10.6-2.6-21-7.6-30.2l-84.3-155.3C524.1 170.2 528 157.5 528 144c0-26.5-21.5-48-48-48H512z"/></svg>');
        }

        .detail-badge.round::before {
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="%23f67186" d="M256 0c4.6 0 9.2 1 13.4 2.9L457.7 82.8c22 9.3 38.4 31 38.3 57.2c-.5 99.2-41.3 280.7-213.6 363.2c-16.7 8-36.1 8-52.8 0C57.3 420.7 16.5 239.2 16 140c-.1-26.2 16.3-47.9 38.3-57.2L242.7 2.9C246.8 1 251.4 0 256 0zm0 66.8V444.8C394 378 431.1 230.1 432 141.4L256 66.8l0 0z"/></svg>');
        }

        .download-tip {
            margin-top: 30px;
            padding: 16px;
            background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
            border-radius: 12px;
            text-align: center;
            font-size: 15px;
            color: white;
            font-weight: bold;
            box-shadow: 0 5px 15px rgba(247, 123, 142, 0.25);
            position: relative;
            overflow: hidden;
        }

        .download-tip::before {
            content: "";
            position: absolute;
            top: -10px;
            left: -10px;
            right: -10px;
            bottom: -10px;
            background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.1) 75%, transparent 75%, transparent);
            background-size: 20px 20px;
            z-index: 1;
            opacity: 0.3;
        }

        .download-tip strong {
            background-color: rgba(255, 255, 255, 0.2);
            padding: 3px 8px;
            border-radius: 6px;
            margin: 0 3px;
            position: relative;
            z-index: 2;
        }

        .footer {
            text-align: center;
            padding: 20px 0 10px;
            font-size: 13px;
            color: #888;
            border-top: 1px solid rgba(247, 123, 142, 0.1);
            margin-top: 10px;
            position: relative;
        }

        .footer::after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 100px;
            height: 3px;
            background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
            border-radius: 3px;
        }
    </style>
</head>

<body>
    <div class="wrapper">
        <div class="app-header">
            <h1 class="app-title">完美CSGO视频时刻</h1>
            <p class="app-subtitle">CSGO PERFECT WORLD HIGHLIGHTS</p>
        </div>

        <!-- 玩家信息 -->
        <div class="info-box">
            <h3 class="section-title">玩家概览</h3>
            <div class="player-info-panel">
                <img src="{{ avatar_url }}" alt="用户头像" class="player-avatar">
                <div class="player-details">
                    <h2 class="player-name">{{ player_name }}</h2>
                    <p class="steam-id">{{ steam_id }}</p>
                </div>
            </div>

            <div class="meta-container">
                <div class="meta-item">
                    <div class="meta-label">视频总数</div>
                    <div class="meta-value">{{ total_count }}</div>
                </div>
            </div>
        </div>

        <div class="divider"></div>

        <!-- 视频列表 -->
        <div class="info-box">
            <h3 class="section-title">完美时刻列表</h3>
            <div class="videos-grid">
                {% for video in videos %}
                <div class="video-card">
                    <div class="video-thumbnail">
                        <div class="video-header">
                            <div class="video-id">ID: {{ video.video_id }}</div>
                            <div class="video-time">{{ video.match_time }}</div>
                        </div>
                        {% if video.cover_url %}
                        <img src="{{ video.cover_url }}" alt="视频封面" class="video-cover">
                        {% else %}
                        <div class="video-cover-placeholder">暂无封面</div>
                        {% endif %}
                    </div>
                    <div class="video-content">
                        <div class="video-title">{{ video.title }}</div>
                        <div class="video-details">
                            <div class="video-detail-item">
                                <span class="video-map">{{ video.map_name }}</span>
                            </div>
                            <div class="video-detail-item">
                                <span class="video-kill-count">{{ video.kill_count }}杀</span>
                            </div>
                            {% if video.versus_count > 0 %}
                            <div class="video-detail-item">
                                <span class="detail-badge versus">{{ video.versus_count }}v对枪</span>
                            </div>
                            {% endif %}
                            <div class="video-detail-item">
                                <span class="detail-badge round">第{{ video.match_round }}回合</span>
                            </div>
                        </div>
                    </div>
                </div>
                {% endfor %}
            </div>

            <div class="download-tip">
                使用 <strong>完美时刻下载 ID前四位</strong> 指令可下载对应视频
            </div>
        </div>

        <div class="footer">
            完美CSGO完美时刻查询 | Zhenxun Bot
        </div>
    </div>
</body>

</html>